package com.yuyou.fn.tms.vo;

import com.yuyou.fn.educational.entity.CourseClass;
import io.swagger.annotations.ApiModelProperty;

/**
 * Created by lzh on 2019/2/21.
 */
public class ClassQuota {
    @ApiModelProperty(name = "班级id")
    private Long claId;
    @ApiModelProperty(name = "剩余学位")
    private Integer surplusQuota;

    public ClassQuota(CourseClass courseClass){
        Integer regAmount=courseClass.getRegAmount()==null?0:courseClass.getRegAmount();
        Integer lockAmount=courseClass.getLockAmount()==null?0:courseClass.getLockAmount();
        this.setClaId(courseClass.getClassId());
        this.setSurplusQuota(courseClass.getQuota()-regAmount-lockAmount);
    }

    public Long getClaId() {
        return claId;
    }

    public void setClaId(Long claId) {
        this.claId = claId;
    }

    public Integer getSurplusQuota() {
        return surplusQuota;
    }

    public void setSurplusQuota(Integer surplusQuota) {
        this.surplusQuota = surplusQuota;
    }


}
